#include <iostream>
using namespace std;
#define MAX 10000
#define LEN 200+5
void HashInit(char* hash)
{
	for (int i = 0; i < MAX; i++)
		hash[i] = -1;
}
void SetSession(char *hash, int *arr, int size)
{
	int num = 0;
	int arr2[LEN];
	for (int i = size - 1; i >= 0; i--){
		if (arr[i]>MAX)
			continue;
		if (hash[arr[i]] != 1){
			arr2[num++] = arr[i];
			hash[arr[i]] = 1;
		}
	}
	for (int i = 0; i < num; i++){
		cout << arr2[i] << " ";
	}
	cout << endl;
}
void testSession()
{
	char hash[MAX];
	int *arr;
	int n;
	cin >> n;
	int size;
	while (n--){
		HashInit(hash);
		cin >> size;
		arr = (int *)malloc(sizeof(int)*size);
		for (int i = 0; i < size; i++){
			cin >> arr[i];
		}
		SetSession(hash, arr, size);
		free(arr);
	}
}